Use "RepeatCalendarLib"


Sub Querysave(Source As Notesuidocument, Continue As Variant)
	
	Dim doc As notesdocument
	Set doc=Source.document
	Continue = CheckFieldValues ( doc ) 
	If Continue Then
		If doc.ReservationStatus(0)= "NEW" Then  doc.ReservationStatus= "SUBMIT"
		doc.Sign
		doc.save True,True
	End If
	
End Sub


Sub Queryclose(Source As Notesuidocument, Continue As Variant)
	
	Dim s As New NotesSession
	Dim db As NotesDatabase
	Set db =s.CurrentDatabase
	Dim doc As notesdocument
	Set doc=Source.document
	
	' Create Recurring Records if status is SUBMIT
	If doc.ReservationStatus(0) = "SUBMIT" Then
		doc.ReservationStatus= "CLOSED"
		Call ProcessRepeatType ( doc )	
		doc.save True,True				
	End If
	
	'Refresh the conf room view if a view exists.
	If doc.Room(0) <> "" Then
		Dim view As NotesView
		Set view = db.GetView( doc.Room(0) )
		Call view.Refresh
	End If
		
End Sub
